console.log('加载index.js');
//初次加载
$$.ajax({
    url:url_get_treasure_hunter_list,
    method:"GET",
	data:{},
	dataType:'json',
	//xhrFields:{withCredentials:true},
	success: function (ajaxresult) {             
	    if(ajaxresult.code==1){
	    	//获取列表数据
	        var data_treasure_hunter_index = ajaxresult.data;
	        //console.log(data_treasure_hunter_index);
	        //写入列表模板
	        var html_treasure_hunter_index = myApp.treasureHunterIndexItemTemplate(data_treasure_hunter_index);
	        $$('#treasure_hunter_index_content').html(html_treasure_hunter_index);
	        //关闭loader
	        $$('.infinite-scroll-preloader').hide();
	        
	    }else{
	    	//关闭loader
	        $$('.infinite-scroll-preloader').hide();
	  	    myApp.alert(ajaxresult.msg);
	    }
	}
});
//从其他页面返回时加载
myApp.onPageInit('treasure_hunter_index', function (page) {
	//开启loader
	$$('.infinite-scroll-preloader').show();
	//重新加载
	$$.ajax({
	    url:url_get_treasure_hunter_list,
	    method:"GET",
		data:{},
		dataType:'json',
		//xhrFields:{withCredentials:true},
		success: function (ajaxresult) {             
		    if(ajaxresult.code==1){
		    	//获取列表数据
		        var data_treasure_hunter_index = ajaxresult.data;
		        //console.log(data_treasure_hunter_index);
		        //写入列表模板
		        var html_treasure_hunter_index = myApp.treasureHunterIndexItemTemplate(data_treasure_hunter_index);
		        $$('#treasure_hunter_index_content').html(html_treasure_hunter_index);
		        //去除loader
		        $$('.infinite-scroll-preloader').hide();
		        
		    }else{
		      //去除loader
		      $$('.infinite-scroll-preloader').hide();
		  	  myApp.alert(ajaxresult.msg);
		    }
		}
	});
});
